<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8' />
    <meta name='viewport' content='width=device-width, initial-scale=1.0' />
    <title>Document</title>
    <script src='../js/vue.js'></script>
</head>

<body>
    <div id='root'>
        <h1>{{city}}</h1>
        <button @click="showCity">点击显示city</button>
        <button @click="showContent($event,666)">点击提示信息</button>
    </div>
    <script>
        const vm = new Vue({
            el: '#root',
            data: {
                city: "北京",
            }, methods: {
                showCity(e) {
                    console.log(e);
                    alert(this.city);
                },
                showContent(e, value) {
                    console.log(value);
                }
            },
        });
    </script>
</body>

</html>